package com.marianmedla.jane16.lib;

/**
 * main class to run the example
 * @author marianmedla
 *
 */
public class Main {

	public void doTest(String fileA, String fileB) throws Exception{
		
		System.out.println( "Start statistical analysis: " );
		String textA = U.loadTextRaw( fileA );
		String textB = U.loadTextRaw( fileB );
		SyntacticalSimilarity.DEBUG = false;
		float similarity = new SyntacticalSimilarity(textA,textB).compute();
		System.out.println( "Similarity is " +  similarity + "%");
		
	}
   
    public static void main(String[] args) throws Exception {
    	
    	String fileA = null;
    	String fileB = null;
    	
        if( args != null && args.length == 2 ){
        	fileA = args[0];
        	fileB = args[1];
        }else{
        	System.out.println("Usage: ");
        	System.out.println("Specify paths to two text files to be compared.");
        	System.out.println("Example: java com.marianmedla.jane16.lib.Main c:/tmp/a.txt  c:/tmp/b.txt");
        	System.exit(-1);
        }
        
    	new Main().doTest( fileA, fileB );

    }
    
}